package com.jplayground.tree;

import java.util.List;
import java.util.ArrayList;

/**
 * @author Natalia Batishcheva
 * @project JPlayground
 * @data: 05.01.2008
 */
public class TreeNodeVO {
    private long id;
    private String name;
    private boolean isLeaf;

    private TreeNodeVO parent;
    private List<TreeNodeVO> subNodes = new ArrayList<TreeNodeVO>();

    public TreeNodeVO() {
    }

    public TreeNodeVO(long id, String name) {
        this.id = id;
        this.name = name;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isLeaf() {
        return isLeaf;
    }

    public void setLeaf(boolean leaf) {
        isLeaf = leaf;
    }

    public TreeNodeVO getParent() {
        return parent;
    }

    public void setParent(TreeNodeVO parent) {
        this.parent = parent;
    }

    public List<TreeNodeVO> getSubNodes() {
        return subNodes;
    }

    public void setSubNodes(List<TreeNodeVO> subNodes) {
        this.subNodes = subNodes;
    }

    public void addSubNode(TreeNodeVO node) {
        this.subNodes.add(node);
    }
}
